<head lang="en">
	<meta charset="UTF-8">
	<title>操作当当购物车页面</title>
	<link type="text/css" rel="stylesheet" href="css/cartStyle.css" />
	<style>
		body,ul,li,div,p,h1,h2,ol{margin:0;padding: 0;}
		body{margin: 5px 0 0 0}
		ul,li,ol{list-style: none;}
		.content{width: 680px; margin: 0 auto;  font-family: "微软雅黑"; border: solid 1px #cecece; padding: 5px;}
		.logo{margin: 10px 0;}
		.logo span{
		    display: inline-block;
		    float: right;
		    width: 60px;
		    height: 30px;
		    line-height: 30px;
		    font-size: 14px;
		    background: #ff0000;
		    color: #ffffff;
		    text-align: center;
		    border-radius: 10px;
		    margin-top: 5px;
		    margin-right: 10px;
		    cursor: pointer;
		    font-weight: bold;
		}
		.cartList{
		    overflow: hidden;
		}
		.cartList ul{
		    clear: both;
		    width: 100%;
		    overflow: hidden;
		    border-bottom: 1px #c6c6c6 dashed;
		    padding-top: 6px;
		}
		.cartList ul li img{width: 60px;
		}
		.cartList ul li{
		    font-family: "微软雅黑";
		    font-size: 12px;
		    color: #666666;
		    text-align: center;
		    line-height: 25px;
		    float: left;
		
		}
		.cartList ul li input[name="price"]{
		    border: none;
		    background: transparent;
		    width: 45px;
		    text-align: center;
		}
		.cartList ul li input[name="amount"]{
		    width: 45px;
		    text-align: center;
		    border: 1px solid #999999;
		    border-left: none;
		    border-right: none;
		    height: 21px;
		}
		.cartList ul li input[name="minus"],.cartList ul li input[name="plus"]{
		    height: 25px;
		    border: 1px #999999 solid;
		    width: 25px;
		    text-align: center;
		}
		.cartList ul li:nth-of-type(1){width: 130px;}
		.cartList ul li:nth-of-type(2){width: 100px;}
		.cartList ul li:nth-of-type(3){width: 130px;}
		.cartList ul li:nth-of-type(4){width: 100px;}
		.cartList ul li:nth-of-type(5){width: 130px;}
		.cartList ul li p{cursor: pointer;}
		.cartList ol{
		    float: right;
		    clear: both;
		}
		.cartList ol li{
		    float: left;
		    width: 200px;
		}
		.cartList ol li:nth-of-type(1) span{
		    color: #ff0000;
		}
		.cartList ol li:nth-of-type(2) span{display: inline-block;
		    float: right;
		    width: 80px;
		    height: 35px;
		    line-height: 35px;
		    font-size: 14px;
		    font-family: "微软雅黑";
		    background: #ff0000;
		    color: #ffffff;
		    text-align: center;
		    margin-top: 5px;
		    margin-right: 15px;
		    cursor: pointer;
		    font-weight: bold;}
	</style>
	<script>
		function collection(){
				  alert("添加成功！")
		}
		function del(){
			var el=document.getElementById("ulid");
			if(window.confirm("真的要删除吗？"))
			el.parentNode.removeChild(el);
			else{
				alert("您放弃了删除");
			}
		}
		function totalPrice(){
			var num1=parseInt(document.getElementById("ammount1").value);
			var num2=parseInt(document.getElementById("ammount2").value);
			var price1=parseFloat(document.getElementById("book1").value);
			var price2=parseFloat(document.getElementById("book2").value);
			var sum=num1*price1+num2*price2;
			alert("总价是："+sum);
		}
	</script>
</head>
<body>

	<div class="content">
		<div class="logo" >
			<img src="images/dd_logo.jpg"><span onclick="window.close()" >关闭</span>
		</div>
		<div class="cartList" id="cartList">
			<ul>
				<li>商品图片</li>
				<li>商品信息</li>
				<li>单价</li>
				<li>数量</li>
				<li>总价</li>
				<li>操作</li>
			</ul>
			<ul id="ulid">
				<li><img src="images/dog.jpg"></li>
				<li>我和狗狗活下来了</li>
				<li>¥<input type="text" id="book1" name="price" value="21.90"></li>
				<li><input type="button" name="minus" value="-" onclick=""><input type="text" id="ammount1" name="amount"
						value="1"><input type="button" name="plus" value="+" onclick=""></li>
				<li id="price0">¥21.90</li>
				<li>
					<p onclick="collection()">移入收藏</p>
					<p  onclick="del()">删除</p>
				</li>
			</ul>
			<ul id="ulid">
				<li><img src="images/mai.jpg"></li>
				<li>灰霾来了怎么办</li>
				<li>¥<input type="text"  id="book2" name="price" value="24.00"></li>
				<li><input type="button" id=name="minus" value="-" onclick=""><input type="text" id="ammount2" name="amount"
						value="1"><input type="button" name="plus" value="+" onclick=""></li>
				<li id="price1">¥24.00</li>
				<li>
					<p onclick="collection()">移入收藏</p>
					<p onclick="del()">删除</p>
				</li>
			</ul>
			<ol>
				<li id="totalPrice">商品总计：<span></span></li>
				<li><span onclick="totalPrice()">结算</span></li>
			</ol>
		</div>
	</div>
</body>
</html>
